﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StudentCourse
{
    class Student:Comparer<Student>
    {
        private string name;
        private int facultyNumber;

        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (value != "")
                {
                    name = value;
                }
                else
                {
                    throw new ArgumentNullException("The name cannot be empty string");
                }

            }
        }

        public int FacultyNumber
        {
            get
            {
                return facultyNumber;
            }
            set
            {
                if (value >= 10000 && value <= 99999)
                {
                    facultyNumber = value;
                }
                else
                {
                    throw new ArgumentOutOfRangeException();
                }
            }
        }

        public Student(string name, int facultyNumber)
        {
            this.Name = name;
            this.FacultyNumber = facultyNumber;
        }

        public override int Compare(Student student1, Student student2)
        {
            return student1.FacultyNumber.CompareTo(student2.FacultyNumber);
        }


    }
}
